<template>
  <div>
    <ul>
      <li v-for="li in lists" :key="li.id">
        <h3>{{ li.title }}</h3>
        <img :src="li.imgUrl" alt="" />
      </li>
    </ul>
  </div>
</template>
<script setup>
import { ref } from 'vue';

import { getJdListsApi } from '../api/home';

const lists = ref([]);

async function getJsLists() {
  try {
    const res = await getJdListsApi();
    lists.value = res.data;
  } catch (err) {
    console.log(err);
  }
}

getJsLists();
</script>
